﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Xml;

namespace SignalBoxEditor.UI
{
    public partial class frmTextInput : Form
    {
        public frmTextInput()
        {
            InitializeComponent();

            SelectedFont = lblSample.Font;
            SelectedColor = Color.Black;

        }

        private Font _selectedFont;

        public Font SelectedFont
        {
            get
            {
                return _selectedFont;
            }
            set
            {
                _selectedFont = value;
                lblSample.Font = value;
            }
        }

        private Color _selectedColor;

        public Color SelectedColor
        {
            get
            {
                return _selectedColor;
            }
            set
            {
                _selectedColor = value;
                lblSample.ForeColor = value;
            }
        }

        private string _enteredText;

        public string EnteredText
        {
            get
            {
                return _enteredText;
            }
            set
            {
                _enteredText = value;
                txtInput.Text = value;
            }
        }

        private void btnFont_Click(object sender, EventArgs e)
        {
            FontDialog dlg = new FontDialog();
            dlg.ShowColor = true;
            dlg.ShowEffects = true;
            dlg.Font = SelectedFont;
            dlg.Color = SelectedColor;
            if (dlg.ShowDialog() == System.Windows.Forms.DialogResult.OK)
            {

                SelectedFont = dlg.Font;
                SelectedColor = dlg.Color;

                lblSample.Font = SelectedFont;
                lblSample.ForeColor = SelectedColor;

            }
        }

        private void txtInput_TextChanged(object sender, EventArgs e)
        {
            lblSample.Text = txtInput.Text;
            _enteredText = txtInput.Text;
        }

        private void button2_Click(object sender, EventArgs e)
        {
            DialogResult = System.Windows.Forms.DialogResult.OK;
            Close();
        }

        private void button3_Click(object sender, EventArgs e)
        {
            DialogResult = System.Windows.Forms.DialogResult.Cancel;
            Close();
        }

       

    }
}
